safe tutorial for MAT foundation design